/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package linkedlist;

/**
 *
 * @author Islam Hamdi
 */
public class NodeS<T> {
private NodeS<T> next;// link_field of the node
	private T element;// Data field of the node

	/** Default constructor for a node */
	public NodeS() {
		next = null;
		element = null;
	}

	/** Constructing a new node given element only */
	public NodeS(T obj) {
		next = null;
		element = obj;
	}

	/** Constructing a new node given element and the next Node */
	public NodeS(T obj, NodeS<T> nextNode) {
		next = nextNode;
		element = obj;
	}

	/** Retrieving the next node */
	public NodeS<T> getNext() {
		return next;
	}

	/** Setting the current node pointing next to the given node */
	public void setNext(NodeS<T> nextN) {
		next = nextN;
	}

	/** Getting element of a node. */
	public T getElement() {
		return element;
	}

	/** Setting element of a note */
	public void setElement(T ob) {
		element = ob;
	}
}
